package com.itheima.controller;

import com.itheima.domain.Emp;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

@Controller
public class EmpController {

    @RequestMapping("/findOne")
    @ResponseBody
    public ModelAndView findOne(ModelAndView modelAndView){
        Emp emp = new Emp();
        emp.setId(1);
        emp.setName("雷老虎");
        modelAndView.addObject("emp",emp);
        modelAndView.setViewName("emps.jsp");
        return modelAndView;
    }
}
